From: Jasper St. Pierre Date: Sun, 16 Sep 2012 17:24:25 +0000 (-0300) Subject: autorunManager: Don't scan the filesystem if autorun is disabled X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5679 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ff9509b901a2984d109b7504b4d190d81dc56b6f;p=gnome-shell.git autorunManager: Don't scan the filesystem if autorun is disabled Content-Type scanning can be expensive, and the user disabled autorun, so... https://bugzilla.gnome.org/show_bug.cgi?id=684093 --- diff --git a/js/ui/components/autorunManager.js b/js/ui/components/autorunManager.js index 942576ad3..495063e38 100644 --- a/js/ui/components/autorunManager.js +++ b/js/ui/components/autorunManager.js @@ -83,13 +83,20 @@ const ContentTypeDiscoverer = new Lang.Class({ _init: function(callback) { this._callback = callback; + this._settings = new Gio.Settings({ schema: SETTINGS_SCHEMA }); }, guessContentTypes: function(mount) { - // guess mount's content types using GIO - mount.guess_content_type(false, null, - Lang.bind(this, - this._onContentTypeGuessed)); + let autorunEnabled = !this._settings.get_boolean(SETTING_DISABLE_AUTORUN); + + if (autorunEnabled) { + // guess mount's content types using GIO + mount.guess_content_type(false, null, + Lang.bind(this, + this._onContentTypeGuessed)); + } else { + this._emitCallback(mount, []); + } }, _onContentTypeGuessed: function(mount, res) {